<template>
  <div>
    <p>当前分类：{{houseTitle}}</p>
    <p v-if="houseList.length===0">暂无该房产分类数据</p>
    <house-item v-for="item in houseList" :house="item" :key="item.id"></house-item>
  </div>
</template>

<script>
import { houseList } from '@/api/house'
export default {
  name: 'HouseIndex',
  props: ['classifyId', 'houseTitle'],
  data () {
    return {
      houseList: []
    }
  },
  created () {
    console.log(this.$route)
    this.getclassifyList()
  },
  mounted () {

  },

  methods: {
    async getclassifyList () {
      try {
        const res = await houseList({
          _limit: 10,
          category: this.classifyId
        })
        console.log(res)
        this.houseList = res
      } catch (error) {
        console.log(error)
      }
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
